<?php
include 'autoload.php';
$id_usuarios = $sessao->getValor('sessao_id_usuarios');
$id_album = (isset($_GET['id_album']) && (!empty($_GET['id_album']))) ? $_GET['id_album'] : null;
try {
    $dadosObj = new SqlCrud();
    $params = array(
        'id_album' => array(
            'valor' => $id_album,
            'pdotype' => PDO::PARAM_INT
        )
    );
    
    $dadosAlbum = $dadosObj->executaSql("SELECT `nome` FROM `album` WHERE `id_album` = :id_album", $params);
    $fotoAlbum = new FotosAjax();
    $dados = $fotoAlbum->listaAlbum($id_album, $smarty);
    $smarty->assign('album', $dadosAlbum[0]['nome']);
    $smarty->assign('dados', $dados);
} catch (Exception $e) {
    new Excecao($e);
}

$smarty->assign('id_album', $id_album);
$smarty->assign('id_usuarios', $id_usuarios);
$smarty->display('lista_foto.tpl');